import { createPage, PAGE_ROOT_SYMBOL } from '../../common/weapp-page'
import { concatClassList, px2rpx } from '@cloudbase/weda-client'
import { app, $app } from '../../app/weapps-api'
import { $1 as handlers } from '../../app/handlers'
const lifecycle = {}
const state = {}
const computed = {}
import { $page, $w } from './api'
import { widgetProps } from './data'





/** widget event listeners **/
const evtListeners = {"onid13$onDataChange": [
      {
          key: '',
          sourceKey: ':',
          handler: ({event})=>{
      if(event.currentTarget) {
        $app.utils.set(event.currentTarget._scope, 'dataContext.data', event?.detail?.data);
        $app.utils.set(event.currentTarget._scope, 'dataContext.state', event?.detail?.state);
      }
    },
          args: {
  "params": [
    {}
  ]
},
          argsBinds: {}
        }
    ],"onid88$tap": [
      {
          key: 'wikvtjl55tg',
          sourceKey: 'platform:showModal',
          handler: function({args}){ return $app.showModal(...args)},
          args: {
  "params": [
    {
      "title": "申请退款",
      "content": "确认发起退款？",
      "cancelText": "取消",
      "showCancel": true,
      "cancelColor": "#000000",
      "confirmText": "确认",
      "confirmColor": "#576B95"
    }
  ]
},
          argsBinds: {}
        }
    ],"onid88$wikvtjl55tg_confirm": [
      {
          key: 'wnrdo7ido4f',
          sourceKey: 'u_ding_dan_ye:query_transaction_id',
          handler: handlers.query_transaction_id,
          args: {
  "params": [
    {}
  ]
},
          argsBinds: {'params.0.target': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      $w.item_dx69.ddh
    )}}
        }
    ],"onid88$wnrdo7ido4f_success": [
      {
          key: 'wehqj3lq7s1',
          sourceKey: 'u_ding_dan_ye:wxpay_refund',
          handler: handlers.wxpay_refund,
          args: {
  "params": [
    {}
  ]
},
          argsBinds: {'params.0.target': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      ({transaction_id:event.detail.transaction_id,ddh:$w.item_dx69.ddh})
    )}}
        }
    ],"onid88$wehqj3lq7s1_success": [
      {
          key: 'wugiiihwjw7',
          sourceKey: 'platform:showToast',
          handler: function({args}){ return $app.showToast(...args)},
          args: {
  "params": [
    {
      "icon": "success",
      "title": "退款成功",
      "duration": 1500
    }
  ]
},
          argsBinds: {}
        },{
          key: 'wd2bf6p4g2i',
          sourceKey: 'platform:cloud.callDataSource',
          handler: function({args}){ return $app.cloud.callDataSource(...args)},
          args: {
  "params": [
    {
      "params": {
        "data": {
          "zfzt": 4
        },
        "select": {
          "$master": true
        }
      },
      "options": {
        "showToast": false,
        "showLoading": false
      },
      "outputs": {},
      "methodName": "wedaUpdateV2",
      "dataSourceName": "wxzfmbddsj_CvVA"
    }
  ]
},
          argsBinds: {'params.0.params.filter': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      {
 "where": {
  "$and": [
   {
    "$and": [
     {
      "_id": {
       "$eq": $w.item_dx69._id
      }
     }
    ]
   }
  ]
 },
 "relateWhere": {}
}
    )}}
        }
    ],"onid88$wd2bf6p4g2i_success": [
      {
          key: 'w8f2zvi07g7',
          sourceKey: 'platform:redirectTo',
          handler: function({args}){ return $app.redirectTo(...args)},
          args: {
  "params": [
    {
      "mode": "weDa",
      "pageId": "u_ding_dan_ye",
      "params": {}
    }
  ]
},
          argsBinds: {}
        }
    ],"onid88$wnrdo7ido4f_fail": [
      {
          key: 'wjnlvg18zg3',
          sourceKey: 'platform:showToast',
          handler: function({args}){ return $app.showToast(...args)},
          args: {
  "params": [
    {
      "icon": "success",
      "duration": 1500
    }
  ]
},
          argsBinds: {'params.0.title': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      event.detail
    )}}
        }
    ],"onid44$onDataChange": [
      {
          key: '',
          sourceKey: ':',
          handler: ({event})=>{
      if(event.currentTarget) {
        $app.utils.set(event.currentTarget._scope, 'dataContext.data', event?.detail?.data);
        $app.utils.set(event.currentTarget._scope, 'dataContext.state', event?.detail?.state);
      }
    },
          args: {
  "params": [
    {}
  ]
},
          argsBinds: {}
        }
    ],"onid54$onDataChange": [
      {
          key: '',
          sourceKey: ':',
          handler: ({event})=>{
      if(event.currentTarget) {
        $app.utils.set(event.currentTarget._scope, 'dataContext.data', event?.detail?.data);
        $app.utils.set(event.currentTarget._scope, 'dataContext.state', event?.detail?.state);
      }
    },
          args: {
  "params": [
    {}
  ]
},
          argsBinds: {}
        }
    ],"onid65$onDataChange": [
      {
          key: '',
          sourceKey: ':',
          handler: ({event})=>{
      if(event.currentTarget) {
        $app.utils.set(event.currentTarget._scope, 'dataContext.data', event?.detail?.data);
        $app.utils.set(event.currentTarget._scope, 'dataContext.state', event?.detail?.state);
      }
    },
          args: {
  "params": [
    {}
  ]
},
          argsBinds: {}
        }
    ],}

const dataBinds = {
  [PAGE_ROOT_SYMBOL]: {
    
  },
  id77: { 'data': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      $w.id13.records
    )}
  },
  id77_item: { '_waFor': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      $w.id13.records
    )}
  },
  id83: { 'text': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      $w.item_dx69.spmc
    )}
  },
  id85: { 'text': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      $w.item_dx69.ddh
    )}
  },
  id87: { 'text': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      $w.item_dx69.zfzt === 1 ? "未支付" : $w.item_dx69.zfzt === 2 ? "已支付" : $w.item_dx69.zfzt === 3 ? "退款中" : "已退款"
    )}
  },
  id88: { '_waIf': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      $w.item_dx69.zfzt === 2 ? true : false
    )},'_waDisplay': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      false
    )},'style': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      ((display)=>{ const style = {...widgetProps.id88.style}; if(!display) {style.display = "none"}; return style })((
false
))
    )}
  },
  id44: { 'where': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      [{"groupLogic":null,"logicData":[{"key":"zfzt","rel":"equal","extra":{"id":"","type":"number","format":"","childId":null,"parentId":null,"isExpression":false,"x-option-name":"","x-multi-select":false},"logic":null,"value":2,"keyType":"field","valueType":"const","expression":true}]}]
    )},'queryCondition': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      [
 {
  "$and": [
   {
    "$and": [
     {
      "zfzt": {
       "$eq": 2
      }
     }
    ]
   }
  ]
 }
]
    )}
  },
  id89: { 'data': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      $context.id44.data
    )}
  },
  id89_item: { '_waFor': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      $context.id44.data
    )}
  },
  id125: { 'text': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      $w.item_s93o.spmc
    )}
  },
  id127: { 'text': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      $w.item_s93o.ddh
    )}
  },
  id129: { 'text': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      $w.item_s93o.zfzt === 1 ? "未支付" : $w.item_s93o.zfzt === 2 ? "已支付" : $w.item_s93o.zfzt === 3 ? "退款中" : "已退款"
    )}
  },
  id130: { '_waIf': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      $w.item_s93o.zfzt === 2 ? true : false
    )},'_waDisplay': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      false
    )},'style': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      ((display)=>{ const style = {...widgetProps.id130.style}; if(!display) {style.display = "none"}; return style })((
false
))
    )}
  },
  id54: { 'where': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      [{"groupLogic":null,"logicData":[{"key":"zfzt","rel":"equal","extra":{"id":"","type":"number","format":"","childId":null,"parentId":null,"isExpression":false,"x-option-name":"","x-multi-select":false},"logic":null,"value":1,"keyType":"field","valueType":"const","expression":true}]}]
    )},'queryCondition': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      [
 {
  "$and": [
   {
    "$and": [
     {
      "zfzt": {
       "$eq": 1
      }
     }
    ]
   }
  ]
 }
]
    )}
  },
  id131: { 'data': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      $context.id54.data
    )}
  },
  id131_item: { '_waFor': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      $context.id54.data
    )}
  },
  id137: { 'text': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      $w.item_vxnd.spmc
    )}
  },
  id139: { 'text': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      $w.item_vxnd.ddh
    )}
  },
  id141: { 'text': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      $w.item_vxnd.zfzt === 1 ? "未支付" : $w.item_vxnd.zfzt === 2 ? "已支付" : $w.item_vxnd.zfzt === 3 ? "退款中" : "已退款"
    )}
  },
  id65: { 'where': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      [{"groupLogic":null,"logicData":[{"key":"zfzt","rel":"equal","extra":{"id":"","type":"number","format":"","childId":null,"parentId":null,"isExpression":false,"x-option-name":"","x-multi-select":false},"logic":null,"value":4,"keyType":"field","valueType":"const","expression":true}]}]
    )},'queryCondition': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      [
 {
  "$and": [
   {
    "$and": [
     {
      "zfzt": {
       "$eq": 4
      }
     }
    ]
   }
  ]
 }
]
    )}
  },
  id142: { 'data': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      $context.id65.data
    )}
  },
  id142_item: { '_waFor': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      $context.id65.data
    )}
  },
  id148: { 'text': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      $w.item_iyf1.spmc
    )}
  },
  id150: { 'text': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      $w.item_iyf1.ddh
    )}
  },
  id152: { 'text': ($page, lists, forItems, event, $context, $w, params) => {const $for = forItems; const $index=lists?.[0]?.currentIndex; return(
      $w.item_iyf1.zfzt === 1 ? "未支付" : $w.item_iyf1.zfzt === 2 ? "已支付" : $w.item_iyf1.zfzt === 3 ? "退款中" : "已退款"
    )}
  },
}

const query = {
}

const eventFlows = [
]

const datasetProfile = {
  "state": {}
}

createPage({
  app,
  pageContext: $page,
  id: 'u_ding_dan_ye',
  widgetProps,
  lifecycle,
  state,
  computed,
  evtListeners,
  dataBinds,
  handlers,
  query,
  eventFlows,
  pageAttributes: {},
  resetShare: false,
  datasetProfile
})
